import configparser
import os

class ReadConfig:
    def get_value(self,option,key):
        root_dir = os.path.dirname(os.path.abspath('.'))  # 获取项目根目录的相对路径
        config = configparser.ConfigParser()
        file_path = os.path.dirname(os.path.abspath('.')) + '/config/config.ini'
        config.read((file_path),encoding="utf-8")
        value = config.get(option, key)
        return value
if __name__ == "__main__":
    config = ReadConfig()
    print(config.get_value("Email","port"))
    print(config.get_mail()[1])